<template>
  <div>
    <div class="top">
      <p>机器人详情</p>
    </div>
    <p class="title">基本信息</p>

    <div class="content">
      <div class="img"></div>
      <div class="contents">
        <p>机器人名称：235测试机器狗</p>
        <p>机器人类型：四足机器人</p>
        <p>机器人编号：235测试机器狗</p>
        <p>机器人型号：Aliengo</p>
        <div class="line">
          <div class="img img1"></div>
          <span>状态：在线</span>
        </div>
        <div class="line">
          <div class="img img2"></div>
          <span>信号：良好</span>
        </div>
        <div class="line">
          <div class="img img3"></div>
          <span>电量：20%</span>
        </div>
        <div class="line">
          <div class="img img4"></div>
          <span>温度：24℃</span>
        </div>
      </div>
      <!-- <div class="button">
        <el-button size="medium">删除</el-button>
        <el-button type="primary"
                   size="medium">修改</el-button>
      </div> -->
    </div>

    <p class="title">任务信息</p>

    <el-table :data="tableData"
              :highlight-current-row="true"
              :header-cell-style="{ background: '#f5f5f5' }">
      <el-table-column prop="num"
                       label="序号"
                       align="center">
      </el-table-column>
      <el-table-column prop="sceneCoding"
                       label="场景编码"
                       align="center">
      </el-table-column>
      <el-table-column prop="sceneName"
                       label="场景名称"
                       align="center">
      </el-table-column>
      <el-table-column prop="taskName"
                       label="任务名称"
                       align="center">
      </el-table-column>
      <el-table-column prop="taskNo"
                       label="任务编号"
                       align="center">
      </el-table-column>
      <el-table-column prop="startTime"
                       label="预计计划开始时间"
                       align="center"
                       width="200">
      </el-table-column>
      <el-table-column prop="endTime"
                       label="预计完成时间"
                       align="center"
                       width="200">
      </el-table-column>
      <el-table-column prop="actualOften"
                       label="实际时常"
                       align="center"
                       width="200">
      </el-table-column>
      <el-table-column prop="taskStatus"
                       label="任务状态"
                       align="center">
        <template slot-scope="scope">
          <font v-if="scope.row.taskStatus==='执行中'"
                color='#1890FF'>执行中</font>
          <font v-else-if="scope.row.taskStatus==='暂停'"
                color='#FF0006'>暂停</font>
          <font v-else-if="scope.row.taskStatus==='完成'"
                color='#00B836'>完成</font>
          <font v-else-if="scope.row.taskStatus==='终止'"
                color='#FFAC00'>终止</font>

        </template>
      </el-table-column>
      <el-table-column label="操作"
                       align="center"
                       width="350">
        <el-button type="text"
                   @click="suspend()">暂停</el-button>
        <el-button type="text"
                   @click="next()">继续</el-button>
        <el-button type="text">任务切换</el-button>
        <el-button type="text"
                   @click="back()">一键返航</el-button>
      </el-table-column>
    </el-table>

    <el-row>
      <el-col :span="12">
        <p class="title">视频浏览</p>
        <div class="show">
          <div class="left">
            <p class="img"></p>
            <span>视频预览</span>
          </div>
          <div class="right">
            <p class="img"></p>
            <span>云台控制</span>
          </div>
        </div>
      </el-col>
      <el-col :span="12">
        <div class="alarm-top">
          <div class="alarm"></div>
          <p class="title title1">异常报警</p>
        </div>
        <ul>
          <li>
            <span>机器人电量过低，请及时处理</span>
            <span>2022/12/08 15:30:56</span>
          </li>
          <li>
            <span>机器人机器人电量过低，请及时处理</span>
            <span>2022/12/08 15:30:56</span>
          </li>
          <li>
            <span>机器人电量过低，请及时处理</span>
            <span>2022/12/08 15:30:56</span>
          </li>
          <li>
            <span>机器人机器人电量过低，请及时处理</span>
            <span>2022/12/08 15:30:56</span>
          </li>
          <li>
            <span>机器人电量过低，请及时处理</span>
            <span>2022/12/08 15:30:56</span>
          </li>
          <li>
            <span>机器人电量过低，请及时处理</span>
            <span>2022/12/08 15:30:56</span>
          </li>
        </ul>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data () {
    return {
      tableData: [
        {
          num: '1',
          sceneCoding: '06170023',
          sceneName: 'CJ001',
          taskName: '0',
          taskNo: 'Rw001',
          startTime: '2022/12/08 15:30:56',
          endTime: '2022/12/08 15:30:56',
          actualOften: '1小时15分钟30秒',
          taskStatus: '执行中'
        },
        {
          num: '2',
          sceneCoding: '06170023',
          sceneName: 'CJ001',
          taskName: '0',
          taskNo: 'Rw001',
          startTime: '2022/12/08 15:30:56',
          endTime: '2022/12/08 15:30:56',
          actualOften: '1小时15分钟30秒',
          taskStatus: '暂停'
        },
        {
          num: '3',
          sceneCoding: '06170023',
          sceneName: 'CJ001',
          taskName: '0',
          taskNo: 'Rw001',
          startTime: '2022/12/08 15:30:56',
          endTime: '2022/12/08 15:30:56',
          actualOften: '1小时15分钟30秒',
          taskStatus: '完成'
        },
        {
          num: '4',
          sceneCoding: '06170023',
          sceneName: 'CJ001',
          taskName: '0',
          taskNo: 'Rw001',
          startTime: '2022/12/08 15:30:56',
          endTime: '2022/12/08 15:30:56',
          actualOften: '1小时15分钟30秒',
          taskStatus: '终止'
        }
      ]
    }
  },
  methods: {
    suspend () {
      this.$confirm('确认暂停此任务？', '暂停任务', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
    },
    next () {
      this.$confirm('确认继续此任务？', '继续任务', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
    },
    back () {
      this.$confirm('确认一键返航终止任务？', '确认一键返航', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
    },
  }
}
</script>

<style lang="scss" scoped>
.el-input,
.el-select,
.el-date-editor {
  width: 100%;
}

.top {
  padding: 0 20px;
  height: 54px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid rgba(230, 230, 230, 0.39);
  p {
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
  }
}

.title {
  margin: 26px 0 16px 20px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: rgba(0, 0, 0, 0.85);
}

.title1 {
  margin-left: 12px;
}

.show {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  margin-left: 20px;
  .left,
  .right {
    text-align: center;
    margin: 10px 0 0 34px;
    .img {
      width: 100%;
      height: 100%;
      background-repeat: no-repeat;
      background-size: 100% 100%;
    }
    span {
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #001638;
    }
  }
  .left {
    width: 384px;
    height: 219px;
    .img {
      background-image: url("../../../assets/robot/video.png");
    }
    span {
      line-height: 39px;
    }
  }
  .right {
    width: 207px;
    height: 207px;
    margin-left: 122px;
    .img {
      background-image: url("../../../assets/robot/PTZ.png");

      box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16);
    }
    span {
      line-height: 50px;
    }
  }
}

.alarm-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  .alarm {
    width: 25px;
    height: 25px;
    background-image: url("../../../assets/robot/alarm.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    margin-top: 10px;
  }
}

ul {
  width: 78%;
  background: rgba(245, 245, 245, 0.39);
  padding: 10px 25px;
  li {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    height: 41px;
    border-bottom: 2px solid rgba(230, 230, 230, 0.39);
    span {
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: rgba(0, 0, 0, 0.65);
    }
  }
}

/deep/ .el-table {
  padding: 0 20px;
}

.content {
  width: 100%;
  height: 140px;
  padding: 10px 20px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  .img {
    width: 10%;
    height: 100%;
    background-image: url("../../../assets/robot/robot1.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }
  .contents {
    width: 50%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    line-height: 45px;
    p {
      width: 25%;
      font-size: 12px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #262626;
      padding-left: 34px;
    }
    .line {
      width: 25%;
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      padding-left: 34px;
      .img {
        background-repeat: no-repeat;
        background-size: 100% 100%;
        margin-right: 5px;
      }
      .img1 {
        width: 12px;
        height: 12px;
        background-image: url("../../../assets/robot/state.png");
      }
      .img2 {
        width: 12px;
        height: 11px;
        background-image: url("../../../assets/robot/signal.png");
      }
      .img3 {
        width: 14px;
        height: 8px;
        background-image: url("../../../assets/robot/power.png");
      }
      .img4 {
        width: 5px;
        height: 12px;
        background-image: url("../../../assets/robot/temperature.png");
      }
      span {
        font-size: 12px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #262626;
      }
    }
  }
  .button {
    width: 8%;
    height: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: space-between;
    margin-left: 68px;
  }
}
</style>